home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’97 / Warrior’s Progress / source code / Source / Libraries / Menus / High Level / MenuBar.h < prev    next >
Encoding:
Text File  |  1997-06-28  |  780 b   |  47 lines  |  [TEXT/CWIE]

  1. // MenuBar.h
  2.  
  3. #ifndef MenuBar_h
  4. #define MenuBar_h
  5.  
  6. #ifndef MenuBarObject_h
  7. #include "MenuBarObject.h"
  8. #endif
  9. #ifndef ListOf_h
  10. #include "ListOf.h"
  11. #endif
  12. #ifndef ListLink_h
  13. #include "ListLink.h"
  14. #endif
  15. #ifndef PostponedEar_h
  16. #include "PostponedEar.h"
  17. #endif
  18.  
  19. class Menu;
  20.  
  21. class MenuBar: public MenuBarObject
  22.   {
  23.     private:
  24.         ListOf< Menu > mainMenus;
  25.         ListOf< Menu > secondaryMenus;
  26.         PostponedEar< MenuBar > listenToUserState;
  27.         
  28.         MenuBar();
  29.         
  30.         void Prepare();
  31.         void Choose( MenuResult );
  32.         
  33.     public:
  34.         static MenuBar& The();
  35.         
  36.         void Add( ListLink<Menu>&, AfterEnd );
  37.         void Add( ListLink<Menu>&, AsSecondaryMenu );
  38.         void Add( ListLink<Menu>&, After, const ListLink<Menu>& );
  39.  
  40.         Menu& operator[]( MenuID ) const;
  41.         
  42.         void Click( Point );
  43.         void Key( ::Key );
  44.   };
  45.  
  46. #endif
  47.